home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / clang / objeas1a.zip / OEDEMO.CPP < prev    next >
C/C++ Source or Header  |  1992-11-04  |  53KB  |  2,123 lines

  1. #include <object.h>
  2. #include <conio.h>
  3. #include <stdio.h>
  4. #include <stdlib.h>
  5. #include <graphics.h>
  6.  
  7.  
  8. //*************************  FUNCTION PROTOTYPES  **************************
  9.  
  10. void initialize();
  11. void introscreen();
  12. void explainscreen();
  13. void windowdemo();
  14. void menudemo();
  15. void stringdemo();
  16. void buttondemo();
  17. void checkboxdemo();
  18. void textmousedemo();
  19. void wrapup();
  20. void sumitup();
  21.  
  22. void initvidbiosdemo();
  23. void initgraphicdemo();
  24.  
  25.  
  26. //***************************  GLOBAL VARIABLES  ***************************
  27.  
  28. extern Mcursor the_mouse;
  29. Screen screen;
  30. int mouse_present=0;
  31.  
  32. //**************************************************************************
  33. //        MAIN
  34. //**************************************************************************
  35.  
  36. void main()
  37. {
  38.     initialize();
  39.     introscreen();
  40.     explainscreen();
  41.     windowdemo();
  42.     menudemo();
  43.     stringdemo();
  44.     buttondemo();
  45.     checkboxdemo();
  46.     textmousedemo();
  47.     wrapup();
  48.  
  49.     initvidbiosdemo();
  50.     initgraphicdemo();
  51.     closegraph();
  52.     puts("Thank you for previewing the ObjectEase library from");
  53.     puts("David S. Reinhart Associates");
  54.     exit(0);
  55. }
  56.  
  57. //**************************************************************************
  58. //        INITIALIZE
  59. //**************************************************************************
  60.  
  61. void initialize()
  62. {
  63.     char ch;
  64.  
  65.     clrscr();
  66.     flushkeys();
  67.     if(!the_mouse.init()) {
  68.         puts("Mouse driver not found. If you have a mouse, press <ESC> now");
  69.         puts("to exit and load your mouse driver. Press any other key to continue.");
  70.         ch=getch();
  71.         if(ch==27)
  72.             exit(1);
  73.         }
  74.     else
  75.         mouse_present=1;
  76.     the_mouse.unarm();
  77.     cursoroff();
  78. }
  79.  
  80. //**************************************************************************
  81. //        INTROSCREEN
  82. //**************************************************************************
  83.  
  84. void introscreen()
  85. {
  86.     int done=0;
  87.     char ch;
  88.  
  89.     clear(32,0,0);
  90.     printc(8,15,0,"This demonstration program is a compilation of demos");
  91.     printc(9,15,0,"for the various libraries which make up the ObjectEase library.");
  92.     printc(10,15,0,"All of the functions demonstrated herein plus many more are now");
  93.     printc(11,15,0,"available in the first COMPLETE C++ library - The ObjectEase");
  94.     printc(12,15,0,"library from David S. Reinhart Associates.");
  95.     printc(22,15+128,0,"Press any key to begin...");
  96.     getch();
  97.     flushkeys();
  98.  
  99.     clear(32,1,1);
  100.     dlay(8);
  101.     smoved(37,1,7,14,1,"Welcome");
  102.     dlay(3);
  103.     smover(9,1,35,14,1,"To The World");
  104.     dlay(3);
  105.     smovel(11,79,40,14,1,"Of");
  106.     dlay(3);
  107.     smoveu(31,25,14,15,1,">>>  ObjectEase  <<<");
  108.  
  109.     Twindow creditwindow;
  110.     creditwindow.init(5,18,76,24,0,3,0,0);
  111.     creditwindow.setborder(DOUBLE);
  112.     creditwindow.zoom();
  113.     creditwindow.title(" DEMO ");
  114.     creditwindow.border();
  115.  
  116.     creditwindow.wprintc(2,15,3,"The ObjectEase Library Demo");
  117.     creditwindow.wprintc(3,15,3,"(c) Copyright 1992 - David S. Reinhart Asociates");
  118.     creditwindow.wprintc(5,14,3,"Press <ENTER> to continue...");
  119.  
  120.     while(!done) {
  121.         smover(16,25,53,11,1,"***");
  122.         if(kbhit()) {
  123.             ch=getch();
  124.             if(ch==13) {
  125.                 ungetch(ch);
  126.                 done=1;
  127.                 continue;
  128.                 }
  129.             }
  130.         smoveu(53,16,5,11,1,"***");
  131.         if(kbhit()) {
  132.             ch=getch();
  133.             if(ch==13) {
  134.                 ungetch(ch);
  135.                 done=1;
  136.                 continue;
  137.                 }
  138.             }
  139.         smovel(5,53,25,11,1,"***");
  140.         if(kbhit()) {
  141.             ch=getch();
  142.             if(ch==13) {
  143.                 ungetch(ch);
  144.                 done=1;
  145.                 continue;
  146.                 }
  147.             }
  148.         smoved(25,5,16,11,1,"***");
  149.         if(kbhit()) {
  150.             ch=getch();
  151.             if(ch==13) {
  152.                 ungetch(ch);
  153.                 done=1;
  154.                 continue;
  155.                 }
  156.             if(ch==27) {
  157.                 clrscr();
  158.                 exit(0);
  159.                 }
  160.             }
  161.         }
  162.     clear(32,1,1);
  163. }
  164.  
  165. //*************************************************************************
  166. //        EXPLAINSCREEN
  167. //*************************************************************************
  168.  
  169. void explainscreen()
  170. {
  171.     char ch;
  172.  
  173.     Twindow mainwindow;
  174.     mainwindow.init(1,1,80,25,15,1,0,0);
  175.     mainwindow.title(" ObjectEase ");
  176.     mainwindow.show();
  177.     mainwindow.divider(HOR,DOUBLE,2);
  178.     printc(2,14,1,"Text Mode Features");
  179.  
  180.     dlay(18);
  181. //WINDOW
  182.     Twindow demowindow;
  183.     demowindow.init(10,5,20,10,0,3,1,9);
  184.     demowindow.zoom();
  185.     printat(11,12,14,1,"Windows");
  186.     dlay(18*2);
  187. //MENU
  188.     Tmenu demomenu;
  189.     itemarray items;
  190.  
  191.     strcpy(items[1],"Item 1");
  192.     strcpy(items[2],"Item 2");
  193.     strcpy(items[3],"Item 3");
  194.  
  195.     demomenu.init(3,items,35,5,15,15,4,14,0,1,9);
  196.     demomenu.setborder(DOUBLE);
  197.     demomenu.show();
  198.     printat(39,12,14,1,"Menus");
  199.     dlay(18*2);
  200. //BUTTON
  201.     Tbutton button1;
  202.     button1.init(64,6," Start ",2);
  203.     Tbutton button2;
  204.     button2.init(64,8," Stop  ",3);
  205.  
  206.     button1.show(1);
  207.     button2.show(1);
  208.     printat(65,12,14,1,"Buttons");
  209.     dlay(18*2);
  210. //STRING
  211.     Tstring the_string;
  212.     Tdate the_date;
  213.  
  214.     the_string.init(20,18,15,0);
  215.     the_string.setincolors(14,0);
  216.     the_string.show();
  217.  
  218.     the_date.init(20,20);
  219.     the_date.setincolors(14,0);
  220.     the_date.show();
  221.  
  222.     printat(10,18,11,1,"Name: ");
  223.     printat(10,20,11,1,"Date: ");
  224.     printat(10,22,14,1,"String Input");
  225.     dlay(18*2);
  226. //CHECKBOX
  227.     Tcheckbox yesbox;
  228.     yesbox.init(60,18,15,1);
  229.     Tcheckbox nobox;
  230.     nobox.init(60,20,15,1);
  231.  
  232.     yesbox.show();
  233.     yesbox.check();
  234.  
  235.     nobox.show();
  236.  
  237.     printat(55,18,15,1,"Yes");
  238.     printat(55,20,15,1,"No ");
  239.     printat(55,22,14,1,"Check Boxes");
  240.     dlay(18*2);
  241.  
  242.     printc(24,15+128,1,"Press <ENTER> to continue");
  243.     flushkeys();
  244. getkey:
  245.     while(!kbhit());
  246.     ch=getch();
  247.     if(ch==27) {
  248.         clrscr();
  249.         exit(0);
  250.         }
  251.     if(ch!=13) {
  252.         flushkeys();
  253.         goto getkey;
  254.         }
  255. }
  256.  
  257. //*************************************************************************
  258. //        WINDOWDEMO
  259. //*************************************************************************
  260.  
  261. void windowdemo()
  262. {
  263.     char ch;
  264.  
  265.     clear(32,1,1);
  266.     dlay(12);
  267.     smover(12,1,37,14,1,"Windows");
  268.     dlay(18*2);
  269.     smover(12,37,74,14,1,"Windows");
  270.     clear(176,15,1);
  271.     dlay(18);
  272.  
  273.     printat(20,10,15,1,"With this simple piece of code...");
  274.     printat(25,12,15,1,"Twindow the_window;");
  275.     printat(25,13,15,1,"the_window.init(10,5,71,20,14,4,1,7);");
  276.     dlay(18*3);
  277.     printat(20,15,15,1,"You have created this window...");
  278.     dlay(18*3);
  279.  
  280.     Twindow demowindow;
  281.     demowindow.init(10,5,71,20,14,4,1,7);
  282.     demowindow.show();
  283.     dlay(18*3);
  284.  
  285.     printat(20,8,15,4,"Want to change the border?  Try this...");
  286.     printat(25,10,15,4,"the_window.setborder(DOUBLE);");
  287.     printat(25,11,15,4,"the_window.border();");
  288.     dlay(18*3);
  289.  
  290.     demowindow.setborder(DOUBLE);
  291.     demowindow.border();
  292.     dlay(18*3);
  293.  
  294.     printat(20,14,15,4,"Now to clear the window...");
  295.     printat(25,16,15,4,"the_window.fill();");
  296.     dlay(18*3);
  297.  
  298.     demowindow.fill();
  299.     dlay(18*3);
  300.  
  301.     printat(20,10,15,4,"Let's add a title. We'll call it Window 1.");
  302.     printat(25,12,15,4,"the_window.title(\"Window 1\");");
  303.     printat(25,13,15,4,"the_window.border();");
  304.     dlay(18*3);
  305.  
  306.     demowindow.title("Window 1");
  307.     demowindow.border();
  308.     dlay(18*3);
  309.     demowindow.fill();
  310.  
  311.     printat(20,10,15,4,"No, how about a heading instead of a title.");
  312.     printat(25,12,15,4,"the_window.divider(HOR,DOUBLE,2);");
  313.     printat(25,13,15,4,"the_window.wprintc(1,15,4,\"Window 1\");");
  314.     dlay(18*3);
  315.  
  316.     demowindow.title("");
  317.     demowindow.border();
  318.     demowindow.divider(HOR,DOUBLE,2);
  319.     demowindow.wprintc(1,15,4,"Window 1");
  320.     dlay(18*3);
  321.  
  322.     demowindow.hide();
  323.     clear(176,15,1);
  324.     dlay(18);
  325.  
  326.     printc(10,15,1,"You can display a window like this...");
  327.     printc(12,15,1,"the_window.show();");
  328.     dlay(18*3);
  329.  
  330.     demowindow.show();
  331.     dlay(18*2);
  332.     demowindow.hide();
  333.     clear(176,15,1);
  334.     dlay(18);
  335.  
  336.     printc(10,15,1,"Or ZOOM it like this...");
  337.     printc(12,15,1,"the_window.zoom();");
  338.     dlay(18*3);
  339.  
  340.     demowindow.zoom();
  341.     dlay(18*2);
  342.     printc(10,15,4,"Hide a window with this call...");
  343.     printc(12,15,4,"the_window.hide();");
  344.     dlay(18*3);
  345.  
  346.     demowindow.hide();
  347.     clear(176,15,1);
  348.     dlay(18*3);
  349.  
  350.     Twindow warray[8];
  351.     for(int i=0;i<8;i++) {
  352.         warray[i].init(18+(i*3),4+(i*2),20+(18+(i*3)),4+(4+(i*2)),i+1,i,1,7);
  353.         warray[i].setborder(DOUBLE);
  354.         warray[i].show();
  355.         }
  356.     Twindow newwindow;
  357.     newwindow.init(5,8,76,12,15,1,1,7);
  358.     newwindow.setborder(DOUBLE);
  359.     newwindow.zoom();
  360.     newwindow.wprintc(2,15,1,"Windows can overlap, and any underlying image is saved.");
  361.     dlay(18*4);
  362.  
  363.     newwindow.hide();
  364.     dlay(18);
  365.  
  366.     for(i=7;i>-1;i--) {
  367.         warray[i].hide();
  368.         dlay(18);
  369.         }
  370.  
  371.     Twindow newerwindow;
  372.     newerwindow.init(4,3,77,18,0,3,1,7);
  373.     newerwindow.setborder(DOUBLE);
  374.     newerwindow.zoom();
  375.     newerwindow.divider(HOR,DOUBLE,2);
  376.     newerwindow.wprintc(1,14,3,"***  Features  ***");
  377.  
  378.     printc(7,0,3,"What you have just seen is just a small sampling of the power");
  379.     printc(8,0,3,"that you control using the Twindow class of the ObjectEase");
  380.     printc(9,0,3,"library. Here is a listing of some additional features:");
  381.     printc(11,15,3,"Change foreground and background colors");
  382.     printc(12,15,3,"Print to a specific window");
  383.     printc(13,15,3,"Specify shadow or no shadow");
  384.     printc(14,15,3,"Have the window tell you all of it's details");
  385.     printc(15,15,3,"Never fear corrupted or lost memory, as a Twindow");
  386.     printc(16,15,3,"frees all of its accociated memory when it leaves scope");
  387.     dlay(18*4);
  388.  
  389.     printc(25,15+128,1,"Press <ENTER> to continue...");
  390. getkey:
  391.     while(!kbhit());
  392.     ch=getch();
  393.     if(ch==27) {
  394.         clrscr();
  395.         exit(0);
  396.         }
  397.     if(ch!=13) {
  398.         flushkeys();
  399.         goto getkey;
  400.         }
  401. }
  402.  
  403. //**************************************************************************
  404. //        MENUDEMO
  405. //**************************************************************************
  406.  
  407. void menudemo()
  408. {
  409.     char ch;
  410.  
  411.     clear(32,1,1);
  412.     dlay(12);
  413.     smover(12,1,38,14,1,"Menus");
  414.     dlay(18*2);
  415.     smover(12,38,76,14,1,"Menus");
  416.     clear(176,15,1);
  417.     dlay(18);
  418.     clear(176,15,1);
  419.  
  420.     Twindow textwindow;
  421.     textwindow.init(5,3,76,15,15,3,1,7);
  422.     textwindow.setborder(DOUBLE);
  423.     textwindow.zoom();
  424.     textwindow.divider(HOR,DOUBLE,2);
  425.     textwindow.wprintc(1,14,3,"Menus");
  426.  
  427.     printc(7,15,3,"The Tmenu class is descended from the Twindow class,");
  428.     printc(8,15,3,"therefore inheriting all of the member functions of the");
  429.     printc(9,15,3,"Twindow class. To use a Tmenu instance in its simplest form");
  430.     printc(10,15,3,"simply pass it the structure containing your menu selections");
  431.     printc(11,15,3,"and capture the returned value. We won't go into details");
  432.     printc(12,15,3,"as with the Twindow class, but rest assured the Tmenu class");
  433.     printc(13,15,3,"is just as powerful and as easy to implement!");
  434.     dlay(18*5);
  435.     printc(25,15+128,1,"Press <ENTER> to continue...");
  436.  
  437. getkey:
  438.     while(!kbhit());
  439.     ch=getch();
  440.     if(ch==27) {
  441.         clrscr();
  442.         exit(0);
  443.         }
  444.     if(ch!=13) {
  445.         flushkeys();
  446.         goto getkey;
  447.         }
  448.  
  449.     clear(176,15,1);
  450.     Tmenu demomenu;
  451.     itemarray items;
  452.  
  453.     strcpy(items[1],"Item number 1");
  454.     strcpy(items[2],"Item number 2");
  455.     strcpy(items[3],"Item number 3");
  456.     strcpy(items[4],"Continue");
  457.  
  458.     demomenu.init(4,items,10,13,20,15,1,14,5,1,8);
  459.     demomenu.title("Sample");
  460.     Twindow the_window;
  461.     the_window.init(15,4,66,8,15,1,1,7);
  462.     the_window.zoom();
  463.     printc(6,14,1,"Go ahead, experiment with this sample menu.");
  464.  
  465.     int done=0;
  466.     while(!done) {
  467.     int choice=demomenu.show();
  468.         switch(choice) {
  469.             case 1: demomenu.cfgd(7);
  470.                     printat(50,13,15,1,"You chose 1");
  471.                     printf("\a");
  472.                     dlay(18);
  473.                     demomenu.cfgd(15);
  474.                     continue;
  475.             case 2: demomenu.cfgd(7);
  476.                     printat(50,13,15,1,"You chose 2");
  477.                     printf("\a");
  478.                     dlay(18);
  479.                     demomenu.cfgd(15);
  480.                     continue;
  481.             case 3: demomenu.cfgd(7);
  482.                     printat(50,13,15,1,"You chose 3");
  483.                     printf("\a");
  484.                     dlay(18);
  485.                     demomenu.cfgd(15);
  486.                     continue;
  487.             case 4: demomenu.cfgd(7);
  488.                     done=1;
  489.                     dlay(9);
  490.                     continue;
  491.             }//switch
  492.         }//done
  493.     demomenu.hide();
  494.     clear(176,15,1);
  495. }
  496.  
  497. //**************************************************************************
  498. //        STRINGDEMO
  499. //**************************************************************************
  500.  
  501. void stringdemo()
  502. {
  503.     char ch;
  504.  
  505.     clear(32,1,1);
  506.     dlay(12);
  507.     smover(12,1,37,14,1,"Strings");
  508.     dlay(18*2);
  509.     smover(12,37,74,14,1,"Strings");
  510.     clear(176,15,1);
  511.  
  512.     Twindow the_window;
  513.     the_window.init(5,3,76,16,0,3,1,7);
  514.     the_window.setborder(DOUBLE);
  515.     the_window.zoom();
  516.     the_window.divider(HOR,DOUBLE,2);
  517.     printc(4,14,3,"String Input");
  518.  
  519.     printc(7,15,3,"The Tstring class is going to be your best friend. There is");
  520.     printc(8,15,3,"NO easier way to get user input in such a variety of formats.");
  521.     printc(9,15,3,"The Tstring class has two descendants, Tnumeral and Tdate");
  522.     printc(10,15,3,"which allow you to capture and convert any data type.");
  523.     printc(11,15,3,"Have you ever tried to design a form that would let the user");
  524.     printc(12,15,3,"move to any desired input field, up or down, back and forth?");
  525.     printc(13,15,3,"If you have, I'm sure you've met with the same frustration as");
  526.     printc(14,15,3,"most other programmers. Your headaches are now over...");
  527.     dlay(18*5);
  528.  
  529.     printc(25,15+128,1,"Press <ENTER> to continue");
  530. getkey:
  531.     while(!kbhit());
  532.     ch=getch();
  533.     if(ch==27) {
  534.         clrscr();
  535.         exit(0);
  536.         }
  537.     if(ch!=13) {
  538.         flushkeys();
  539.         goto getkey;
  540.         }
  541.     the_window.hide();
  542.     clear(176,15,1);
  543.  
  544.     Twindow formwindow;
  545.     formwindow.init(10,5,71,17,14,2,1,7);
  546.     formwindow.title("Input");
  547.     formwindow.show();
  548.  
  549.     Tstring lname;
  550.     Tstring fname;
  551.     Tstring address;
  552.     Tstring csz;
  553.     Tnumeral age;
  554.  
  555.     lname.init(40,7,15,0);
  556.     lname.setincolors(15,0);
  557.     fname.init(40,9,10,0);
  558.     fname.setincolors(15,0);
  559.     address.init(40,11,20,0);
  560.     address.setincolors(15,0);
  561.     csz.init(40,13,25,0);
  562.     csz.setincolors(15,0);
  563.     age.init(40,15,2,0);
  564.     age.setincolors(15,0);
  565.  
  566.     printc(2,14,1,"Try this one on for size...");
  567.     printc(3,14,1,"Notice that all of the standard editing keys are available.");
  568.  
  569.     printat(15,7,14,2,"Last name: ");
  570.     lname.show();
  571.     printat(15,9,14,2,"First name: ");
  572.     fname.show();
  573.     printat(15,11,14,2,"Address: ");
  574.     address.show();
  575.     printat(15,13,14,2,"City, State, Zip: ");
  576.     csz.show();
  577.     printat(15,15,14,2,"Age: ");
  578.     age.show();
  579.  
  580.     cursoron();
  581. getlname:
  582.     lname.get_form_input();
  583.     if(lname.uparrowhit())
  584.         goto getage;
  585.     if(lname.dnarrowhit())
  586.         goto getfname;
  587. getfname:
  588.     fname.get_form_input();
  589.     if(fname.dnarrowhit())
  590.         goto getaddress;
  591.     if(fname.uparrowhit())
  592.         goto getlname;
  593. getaddress:
  594.     address.get_form_input();
  595.     if(address.uparrowhit())
  596.         goto getfname;
  597.     if(address.dnarrowhit())
  598.         goto getcsz;
  599. getcsz:
  600.     csz.get_form_input();
  601.     if(csz.uparrowhit())
  602.         goto getaddress;
  603.     if(csz.dnarrowhit())
  604.         goto getage;
  605. getage:
  606.     age.get_form_input();
  607.     if(age.uparrowhit())
  608.         goto getcsz;
  609.     if(age.dnarrowhit())
  610.         goto getlname;
  611.  
  612.     cursoroff();
  613.     vprintat(35,20,15,1,"%s %s",fname.getstring(),lname.getstring());
  614.     vprintat(35,21,15,1,"%s",address.getstring());
  615.     vprintat(35,22,15,1,"%s",csz.getstring());
  616.     vprintat(35,23,15,1,"%d",age.getint());
  617.     dlay(18*2);
  618.  
  619.     formwindow.hide();
  620.     clear(176,15,1);
  621.  
  622.     the_window.zoom();
  623.     printc(5,14,3,"Additional features");
  624.     printc(7,15,3,"Force strings to all capitals");
  625.     printc(8,15,3,"Detect <ENTER>, <ESC>, <TAB>, <UP ARROW>, <DN ARROW>");
  626.     printc(9,15,3,"<HOME>, <END>, <BACKSPACE>, <DEL>, as well as mouse keypresses");
  627.     printc(10,15,3,"Return numerals as ints, floats, or longs");
  628.     printc(11,15,3,"Change the colors of the input fields");
  629.     printc(12,15,3,"Format and verify date fields");
  630.     dlay(18*5);
  631.  
  632.     flushkeys();
  633.     printc(25,15+128,1,"Press <ENTER> to continue...");
  634.     getch();
  635. }
  636.  
  637. //**************************************************************************
  638. //        BUTTONDEMO
  639. //**************************************************************************
  640.  
  641. void buttondemo()
  642. {
  643.     int done=0;
  644.     char ch;
  645.  
  646.     clear(32,1,1);
  647.     dlay(12);
  648.     smover(12,1,37,14,1,"Buttons");
  649.     dlay(18*2);
  650.     smover(12,37,74,14,1,"Buttons");
  651.     clear(176,15,1);
  652.     dlay(9);
  653.  
  654.     Twindow demowindow;
  655.     demowindow.init(5,3,76,18,15,3,1,7);
  656.     demowindow.setborder(DOUBLE);
  657.     demowindow.zoom();
  658.     demowindow.divider(HOR,DOUBLE,2);
  659.  
  660.     printc(4,14,3,"Buttons");
  661.  
  662.     printc(7,15,3,"Pushbuttons provide yet another easy way to get input from");
  663.     printc(8,15,3,"the users of your applications. There are times when a menu");
  664.     printc(9,15,3,"is just too much, and that's when a pushbutton can serve the");
  665.     printc(10,15,3,"purpose perfectly. Pushbuttons can be activated by any trigger");
  666.     printc(11,15,3,"you choose, but the most common trigger is the ALT key combined");
  667.     printc(12,15,3,"with the highlighted letter, or of course the mouse.");
  668.     printc(13,15,3,"Give these buttons a try to get a feel for their use...");
  669.  
  670.     Tbutton button1;
  671.     button1.init(20,15,"Button 1",1);
  672.     Tbutton button2;
  673.     button2.init(35,15,"Button 2",2);
  674.     Tbutton button3;
  675.     button3.init(50,15,"Continue",1);
  676.  
  677.     button1.show(3);
  678.     button2.show(3);
  679.     button3.show(3);
  680.  
  681.     while(!done) {
  682.         if(kbhit()) {
  683.             ch=getch();
  684.             if(altkey()) {
  685.                 ch=getch();
  686.                 switch(ch) {
  687.                     case ALTB:    button1.press(3);
  688.                                 while(altkey());
  689.                                 button1.show(3);
  690.                                 continue;
  691.                     case ALTU:    button2.press(3);
  692.                                 while(altkey());
  693.                                 button2.show(3);
  694.                                 continue;
  695.                     case ALTC:    button3.press(3);
  696.                                 while(altkey());
  697.                                 button3.show(3);
  698.                                 done=1;
  699.                                 continue;
  700.                     }
  701.                 }//if altkey
  702.             else
  703.                 flushkeys();
  704.             }//if kbhit
  705.         }//while
  706.     clear(176,15,1);
  707. }
  708.  
  709. //*************************************************************************
  710. //        CHECKBOXDEMO
  711. //*************************************************************************
  712.  
  713. void checkboxdemo()
  714. {
  715.     char ch;
  716.     int done=0;
  717.  
  718.     clear(32,1,1);
  719.     dlay(12);
  720.     smover(12,1,35,14,1,"Checkboxes");
  721.     dlay(18*2);
  722.     smover(12,35,71,14,1,"Checkboxes");
  723.     clear(176,15,1);
  724.     dlay(9);
  725.  
  726.     Twindow the_window;
  727.     the_window.init(5,3,76,19,15,3,1,7);
  728.     the_window.setborder(DOUBLE);
  729.     the_window.zoom();
  730.     the_window.divider(HOR,DOUBLE,2);
  731.     printc(4,14,3,"Checkboxes");
  732.  
  733.  
  734.     printc(7,15,3,"One final way to capture user input is through the use of");
  735.     printc(8,15,3,"checkboxes. Checkboxes can provide the user with a means of");
  736.     printc(9,15,3,"making multiple selections. All your program needs to do");
  737.     printc(10,15,3,"\"ask\" the checkbox if it has been checked or not. The");
  738.     printc(11,15,3,"POWER of the object! The spacebar or the mouse is generally");
  739.     printc(12,15,3,"the trigger to toggle a checkbox's state, however, you may");
  740.     printc(13,15,3,"employ any trigger you choose. Try these samples using the");
  741.     printc(14,15,3,"<TAB> key to move among the checkboxes. Check the CONTINUE");
  742.     printc(15,15,3,"box and press <ENTER> when done.");
  743.  
  744.     Tcheckbox check1;
  745.     check1.init(25,17,14,3);
  746.     Tcheckbox check2;
  747.     check2.init(40,17,14,3);
  748.     Tcheckbox check3;
  749.     check3.init(55,17,14,3);
  750.  
  751.     printat(15,17,15,3,"Check #1:");
  752.     check1.show();
  753.     printat(30,17,15,3,"Check #2:");
  754.     check2.show();
  755.     printat(45,17,15,3,"Continue:");
  756.     check3.show();
  757.  
  758.     cursoron();
  759.     check1.grabcursor();
  760.  
  761.     int active1=1,active2=0,active3=0;
  762.     while(!done) {
  763.         if(kbhit()) {
  764.             ch=getch();
  765.             if(ch!=32 && ch!=9 && ch!=13) {
  766.                 flushkeys();
  767.                 continue;
  768.                 }
  769.             if(ch==32) {
  770.                 if(active1) {
  771.                     if(check1.ischecked())
  772.                         check1.uncheck();
  773.                     else
  774.                         check1.check();
  775.                     }
  776.                 if(active2) {
  777.                     if(check2.ischecked())
  778.                         check2.uncheck();
  779.                     else
  780.                         check2.check();
  781.                     }
  782.                 if(active3) {
  783.                     if(check3.ischecked())
  784.                         check3.uncheck();
  785.                     else
  786.                         check3.check();
  787.                     }
  788.                 }//ch==32
  789.             if(ch==9) {
  790.                 if(active1) {
  791.                     check2.grabcursor();
  792.                     active1=0;
  793.                     active2=1;
  794.                     continue;
  795.                     }
  796.                 if(active2) {
  797.                     check3.grabcursor();
  798.                     active2=0;
  799.                     active3=1;
  800.                     continue;
  801.                     }
  802.                 if(active3) {
  803.                     check1.grabcursor();
  804.                     active3=0;
  805.                     active1=1;
  806.                     continue;
  807.                     }
  808.                 }//ch==9;
  809.             if(ch==13) {
  810.                 if(check3.ischecked()) {
  811.                     done=1;
  812.                     continue;
  813.                     }
  814.                 }
  815.             }//kbhit
  816.         }//!done
  817.     cursoroff();
  818.     clear(176,15,1);
  819.     dlay(18*1);
  820. }
  821.  
  822. //**************************************************************************
  823. //        TEXTMOUSEDEMO
  824. //**************************************************************************
  825.  
  826. void textmousedemo()
  827. {
  828.     int done=0;
  829.     char ch;
  830.  
  831.     Twindow top;
  832.     top.init(1,1,80,4,15,1,0,0);
  833.     top.zoom();
  834.     printc(2,14,1,"OK, now let's put it all to use. If you have a mouse,");
  835.     printc(3,14,1,"use it also to select any field or option you choose.");
  836.  
  837.     Twindow form;
  838.     form.init(5,6,76,15,15,3,1,7);
  839.     form.setborder(DOUBLE);
  840.     form.show();
  841.  
  842.     Tstring lname;
  843.     Tstring fname;
  844.  
  845.     Tbutton donebutton;
  846.     donebutton.init(55,11," Complete ",2);
  847.     Tcheckbox yesbox;
  848.     yesbox.init(45,11,15,3);
  849.     Tcheckbox nobox;
  850.     nobox.init(45,13,15,3);
  851.  
  852.     printat(10,7,14,3,"First name: ");
  853.     printat(10,9,14,3,"Last name:  ");
  854.     fname.init(25,7,10,0);
  855.     fname.setincolors(14,0);
  856.     fname.show();
  857.     lname.init(25,9,15,0);
  858.     lname.setincolors(14,0);
  859.     lname.show();
  860.  
  861.     printat(10,12,14,3,"Enjoying demo thus far?");
  862.     printat(40,11,14,3,"Yes");
  863.     printat(40,13,14,3,"No ");
  864.     yesbox.show();
  865.     nobox.show();
  866.     yesbox.check();
  867.  
  868.     donebutton.show(3);
  869.     the_mouse.arm();
  870.     cursoron();
  871.  
  872.     while(!done) {
  873. getfname:
  874.         fname.get_form_mouse_input();
  875.         if(the_mouse.LBP())
  876.             goto checkmouse;
  877.         if(fname.dnarrowhit() || fname.tabhit())
  878.             goto getlname;
  879.         if(fname.uparrowhit())
  880.             goto getdone;
  881. getlname:
  882.         lname.get_form_mouse_input();
  883.         if(the_mouse.LBP())
  884.             goto checkmouse;
  885.         if(lname.uparrowhit())
  886.             goto getfname;
  887.         if(lname.dnarrowhit() || lname.tabhit())
  888.             goto getyes;
  889. getyes:
  890.         yesbox.grabcursor();
  891.         while(!kbhit() && !the_mouse.LBP());
  892.         if(the_mouse.LBP())
  893.             goto checkmouse;
  894.         ch=getch();
  895.         if(ch==32) {
  896.             if(yesbox.ischecked()) {
  897.                 yesbox.uncheck();
  898.                 nobox.check();
  899.                 }
  900.             else {
  901.                 yesbox.check();
  902.                 nobox.uncheck();
  903.                 }
  904.             }
  905.         if(ch==9) {
  906.             flushkeys();
  907.             goto getno;
  908.             }
  909.         if(ch==0) {
  910.             ch=getch();
  911.             if(ch==80)
  912.                 goto getno;
  913.             if(ch==72)
  914.                 goto getlname;
  915.             flushkeys();
  916.             }
  917.         else {
  918.             flushkeys();
  919.             goto getyes;
  920.             }
  921. getno:
  922.         nobox.grabcursor();
  923.         while(!kbhit() && !the_mouse.LBP());
  924.         if(the_mouse.LBP())
  925.             goto checkmouse;
  926.         ch=getch();
  927.         if(ch==32) {
  928.             if(nobox.ischecked()) {
  929.                 nobox.uncheck();
  930.                 yesbox.check();
  931.                 }
  932.             else {
  933.                 nobox.check();
  934.                 yesbox.uncheck();
  935.                 }
  936.             }
  937.         if(ch==9) {
  938.             flushkeys();
  939.             goto getdone;
  940.             }
  941.         if(ch==0) {
  942.             ch=getch();
  943.             if(ch==80)
  944.                 goto getdone;
  945.             if(ch==72)
  946.                 goto getyes;
  947.             flushkeys();
  948.             }
  949.         else {
  950.             flushkeys();
  951.             goto getno;
  952.             }
  953.  
  954. getdone:
  955.         gotoxy(57,11);
  956.         while(!kbhit() && ! the_mouse.LBP());
  957.         if(the_mouse.LBP())
  958.             goto checkmouse;
  959.  
  960.         ch=getch();
  961.         if(altkey()) {
  962.             ch=getch();
  963.             if(ch==ALTC) {
  964.                 donebutton.press(3);
  965.                 while(altkey());
  966.                 donebutton.show(3);
  967.                 done=1;
  968.                 continue;
  969.                 }
  970.             }
  971.         if(ch==13) {
  972.             donebutton.press(3);
  973.             dlay(3);
  974.             donebutton.show(3);
  975.             done=1;
  976.             continue;
  977.             }
  978.         if(ch==9)
  979.             goto getfname;
  980.         if(ch==0) {
  981.             ch=getch();
  982.             if(ch==72)
  983.                 goto getno;
  984.             if(ch==80)
  985.                 goto getfname;
  986.             flushkeys();
  987.             }
  988.  
  989. checkmouse:
  990.         if(the_mouse.LBP()) {
  991.             if(fname.hit()) {
  992.                 while(the_mouse.LBP());
  993.                 goto getfname;
  994.                 }
  995.             if(lname.hit()) {
  996.                 while(the_mouse.LBP());
  997.                 goto getlname;
  998.                 }
  999.             if(yesbox.hit()) {
  1000.                 if(yesbox.ischecked()) {
  1001.                     yesbox.uncheck();
  1002.                     nobox.check();
  1003.                     while(the_mouse.LBP());
  1004.                     }
  1005.                 else {
  1006.                     yesbox.check();
  1007.                     nobox.uncheck();
  1008.                     while(the_mouse.LBP());
  1009.                     }
  1010.                 goto getyes;
  1011.                 }
  1012.             if(nobox.hit()) {
  1013.                 if(nobox.ischecked()) {
  1014.                     nobox.uncheck();
  1015.                     yesbox.check();
  1016.                     while(the_mouse.LBP());
  1017.                     }
  1018.                 else {
  1019.                     nobox.check();
  1020.                     yesbox.uncheck();
  1021.                     while(the_mouse.LBP());
  1022.                     }
  1023.                 goto getno;
  1024.                 }
  1025.             if(donebutton.buttonpressed()) {
  1026.                 donebutton.press(3);
  1027.                 while(the_mouse.LBP());
  1028.                 donebutton.show(3);
  1029.                 done=1;
  1030.                 continue;
  1031.                 }
  1032.             }
  1033.         }//while !done
  1034.     cursoroff();
  1035. }
  1036.  
  1037. //**************************************************************************
  1038. //        WRAPUP
  1039. //**************************************************************************
  1040.  
  1041. void wrapup()
  1042. {
  1043.     clear(32,1,1);
  1044.     dlay(12);
  1045.     smoved(36,1,12,14,1,"Summary");
  1046.     dlay(18*2);
  1047.     smoveu(36,12,1,14,1,"Summary");
  1048.     clear(176,15,1);
  1049.     dlay(9);
  1050.  
  1051.     Twindow summwindow;
  1052.     summwindow.init(4,3,77,19,14,2,1,7);
  1053.     summwindow.show();
  1054.     summwindow.divider(HOR,DOUBLE,2);
  1055.     summwindow.wprintc(1,15,2,"Text Mode Features");
  1056.  
  1057.     printc(7,14,2,"You have now seen the richness of the features available");
  1058.     printc(8,14,2,"in the text mode objects of the ObjectEase class library.");
  1059.     printc(9,14,2,"Understand that this demo does not allow for all of the member");
  1060.     printc(10,14,2,"functions to be demonstrated. You, the programmer, have total");
  1061.     printc(11,14,2,"control over every aspect of these objects. End the cycle of");
  1062.     printc(12,14,2,"re-inventing the wheel... use these objects to piece together");
  1063.     printc(13,14,2,"application after application maintaining consistency and ease");
  1064.     printc(14,14,2,"of use. Object oriented technology makes application development");
  1065.     printc(15,14,2,"so much easier for the programmer. You need to take advantage");
  1066.     printc(16,14,2,"of this power NOW, or be left behind in the 1990's!");
  1067.     dlay(18*8);
  1068.  
  1069.     printc(25,15+128,1,"Press <ENTER> to continue...");
  1070.     getch();
  1071. }
  1072.  
  1073. #define BKG     3
  1074.  
  1075. //***************************DEMO FUNCTIONS*********************************
  1076. void gbuttondemo();
  1077. void graphbuttondemo();
  1078. void paneldemo();
  1079. void icondemo();
  1080. void acticondemo();
  1081. void gmenudemo();
  1082. void inputdemo();
  1083. void finale();
  1084. void mcursordemo();
  1085.  
  1086. //************************SUPPORTING FUNCTIONS******************************
  1087. void write3d(int,char *);
  1088. void early_exit();
  1089. void norm_exit();
  1090. void do_siren();
  1091. void do_tele();
  1092.  
  1093. //**************************GLOBAL VARIABLES********************************
  1094. char ch; //generic character variable
  1095.  
  1096. //**************************************************************************
  1097. //**************************************************************************
  1098. //**************************************************************************
  1099.  
  1100. void initgraphicdemo()
  1101. {
  1102.     int gd=VGA,gm=VGAHI;
  1103.     int errorcode;
  1104.  
  1105.     if(!the_mouse.init()) {
  1106.         puts("Unable to detect mouse driver. Graphic portion of this demo");
  1107.         puts("requires a mouse.");
  1108.         exit(1);
  1109.         }
  1110.  
  1111.     registerbgidriver(EGAVGA_driver);
  1112.     initgraph(&gd,&gm,"");
  1113.     errorcode=graphresult();
  1114.     if(errorcode!=grOk) {
  1115.         puts("Could not establish 640 x 480 16 color graphics mode");
  1116.         exit(1);
  1117.         }
  1118.     delay(1000);
  1119.  
  1120.     setfillstyle(SOLID_FILL,BKG);
  1121.     bar(0,0,getmaxx(),getmaxy());
  1122.  
  1123.     Bevel mainpanel;
  1124.  
  1125.     mainpanel.init(50,75,540,125,THICK);
  1126.     mainpanel.show();
  1127.  
  1128.     settextjustify(CENTER_TEXT,TOP_TEXT);
  1129.     write3d(100,"ObjectEase graphics demonstration for Borland C++ and");
  1130.     write3d(115,"Turbo C++. This demo and the included graphics library file(s)");
  1131.     write3d(130,"(c) Copyright 1992, David S. Reinhart Associates");
  1132.  
  1133.     write3d(160,"Press the <ENTER> key or the right mouse key to progress through");
  1134.     write3d(175,"the demo.");
  1135.  
  1136.     Panel copyrightpanel;
  1137.     copyrightpanel.init(3,455,634,21,OUT,THIN);
  1138.     copyrightpanel.show();
  1139.     setcolor(0);
  1140.     write3d(465,"(c) Copyright 1992 - David S. Reinhart Associates");
  1141.  
  1142.     the_mouse.show();
  1143.  
  1144.     int selected=0;
  1145.     while(!selected) {
  1146.         while(!kbhit() && !the_mouse.RBP());
  1147.         if(kbhit()) {
  1148.             if((ch=getch())==27)
  1149.                 early_exit();
  1150.             while(kbhit())getch();
  1151.             selected=1;
  1152.             }
  1153.         if(the_mouse.RBP())
  1154.             selected=1;
  1155.         }
  1156.  
  1157.  
  1158.     gbuttondemo();
  1159.     graphbuttondemo();
  1160.     icondemo();
  1161.     acticondemo();
  1162.     paneldemo();
  1163.     gmenudemo();
  1164.     inputdemo();
  1165.     mcursordemo();
  1166.     finale();
  1167. //    norm_exit();
  1168. }
  1169.  
  1170. void mcursordemo()
  1171. {
  1172.     int cur=1;
  1173.  
  1174.     the_mouse.hide();
  1175.     setfillstyle(SOLID_FILL,3);
  1176.     bar(0,0,getmaxx(),getmaxy()-30);
  1177.  
  1178.     write3d(20,"Press the left mouse key to cycle through cursors.");
  1179.     write3d(35,"Press right mouse key to end.");
  1180.  
  1181.     the_mouse.show();
  1182.     while(!the_mouse.RBP()) {
  1183.         if(the_mouse.LBP()) {
  1184.             cur++;
  1185.             if(cur>16)cur=1;
  1186.             the_mouse.changeto(cur);
  1187.             while(the_mouse.LBP());
  1188.             }
  1189.         }
  1190. }
  1191.  
  1192. //**************************************************************************
  1193.  
  1194. void gbuttondemo()
  1195. {
  1196.     setfillstyle(SOLID_FILL,BKG);
  1197.     the_mouse.hide();
  1198.     bar(0,0,getmaxx(),getmaxy()-40);
  1199.  
  1200.  
  1201.     Bevel mainpanel;
  1202.     mainpanel.init(30,70,580,230,THICK);
  1203.     mainpanel.show();
  1204.  
  1205.     write3d(85,"Buttons are one of the most fundamental graphic objects.");
  1206.     write3d(100,"They are very popular within graphics environments");
  1207.     write3d(115,"for getting user input. You, the programmer, have complete");
  1208.     write3d(130,"control over how these button objects function. That is");
  1209.     write3d(145,"to say, whether the resulting action takes place when the");
  1210.     write3d(160,"button is pressed or released; how long the button remains");
  1211.     write3d(175,"depressed; etc...  Experiment with the buttons below.");
  1212.  
  1213.     Button lowbutton;
  1214.     Button medbutton;
  1215.     Button hibutton;
  1216.     Panel buttonpanel;
  1217.  
  1218.     lowbutton.init(150,230," LOW ",TEXT);
  1219.     medbutton.init(300,230," MED ",TEXT);
  1220.     hibutton.init(450,230," HI  ",TEXT);
  1221.     buttonpanel.init(130,220,390,45,IN,THICK);
  1222.     buttonpanel.show();
  1223.  
  1224.     lowbutton.show();
  1225.     medbutton.show();
  1226.     hibutton.show();
  1227.  
  1228.     the_mouse.show();
  1229.     int selected=0;
  1230.  
  1231.     flushkeys();
  1232.     while(!selected) {
  1233.         if(the_mouse.LBP()) {
  1234.             if(lowbutton.hit()) {
  1235.                 lowbutton.press();
  1236.                 while(the_mouse.LBP() && lowbutton.hit());
  1237.                 lowbutton.show();
  1238.                 if(lowbutton.hit()) {
  1239.                     sound(220);
  1240.                     delay(500);
  1241.                     nosound();
  1242.                     continue;
  1243.                     }
  1244.                 }
  1245.             if(medbutton.hit()) {
  1246.                 medbutton.press();
  1247.                 while(the_mouse.LBP() && medbutton.hit());
  1248.                 medbutton.show();
  1249.                 if(medbutton.hit()) {
  1250.                     sound(440);
  1251.                     delay(500);
  1252.                     nosound();
  1253.                     continue;
  1254.                     }
  1255.                 }
  1256.             if(hibutton.hit()) {
  1257.                 hibutton.press();
  1258.                 while(the_mouse.LBP() && hibutton.hit());
  1259.                 hibutton.show();
  1260.                 if(hibutton.hit()) {
  1261.                     sound(880);
  1262.                     delay(500);
  1263.                     nosound();
  1264.                     continue;
  1265.                     }
  1266.                 }
  1267.             }// end if the_mouse.LBP
  1268.         if(the_mouse.RBP()) {
  1269.             selected=1;
  1270.             }
  1271.         if(kbhit()) {
  1272.             if((ch=getch())==27)
  1273.                 early_exit();
  1274.             while(kbhit())getch();
  1275.             selected=1;
  1276.             }
  1277.         }// end while !selected
  1278. }
  1279.  
  1280. //**************************************************************************
  1281.  
  1282. void graphbuttondemo()
  1283. {
  1284.     the_mouse.hide();
  1285.     setfillstyle(SOLID_FILL,BKG);
  1286.     bar(0,0,getmaxx(),getmaxy()-40);
  1287.  
  1288.     Bevel mainpanel;
  1289.     mainpanel.init(50,50,getmaxx()-100,250,THICK);
  1290.     mainpanel.show();
  1291.  
  1292.     write3d(75,"Buttons can have not only text labels, but graphics as well!");
  1293.     write3d(90,"Graphics not only make the interface look nicer, but can");
  1294.     write3d(105,"also make the button's function more intuitive for the end user.");
  1295.     write3d(120,"Try to guess what the outcome will be before trying out each of");
  1296.     write3d(135,"the buttons below.");
  1297.     write3d(165,"By the way, these graphic buttons are easy to create using the");
  1298.     write3d(180,"ICONEDIT program supplied in this package.");
  1299.  
  1300.     Panel buttonpanel;
  1301.     Button sirenbutton;
  1302.     Button telebutton;
  1303.  
  1304.     buttonpanel.init(270,220,100,50,IN,THICK);
  1305.     buttonpanel.show();
  1306.     sirenbutton.init(285,235,"siren",1);
  1307.     telebutton.init(330,235,"telefone",1);
  1308.     sirenbutton.show();
  1309.     telebutton.show();
  1310.     the_mouse.show();
  1311.  
  1312.     flushkeys();
  1313.     int selected=0;
  1314.     while(!selected) {
  1315.         if(the_mouse.RBP())
  1316.             selected=1;
  1317.         if(kbhit()) {
  1318.             if((ch=getch())==27)
  1319.                 early_exit();
  1320.             while(kbhit())getch();
  1321.             selected=1;
  1322.             }
  1323.         if(the_mouse.LBP()) {
  1324.             if(sirenbutton.hit()) {
  1325.                 sirenbutton.press();
  1326.                 while(the_mouse.LBP() && sirenbutton.hit());
  1327.                 sirenbutton.show();
  1328.                 if(sirenbutton.hit()) {
  1329.                     do_siren();
  1330.                     continue;
  1331.                     }
  1332.                 }
  1333.             if(telebutton.hit()) {
  1334.                 telebutton.press();
  1335.                 while(the_mouse.LBP() && telebutton.hit());
  1336.                 telebutton.show();
  1337.                 if(telebutton.hit()) {
  1338.                     do_tele();
  1339.                     continue;
  1340.                     }
  1341.                 }
  1342.             }
  1343.         }
  1344. }
  1345.  
  1346. //**************************************************************************
  1347.  
  1348. void paneldemo()
  1349. {
  1350.     the_mouse.hide();
  1351.     setfillstyle(SOLID_FILL,BKG);
  1352.     bar(0,0,getmaxx(),getmaxy()-40);
  1353.  
  1354.     Bevel mainpanel;
  1355.     mainpanel.init(10,10,getmaxx()-20,70,THICK);
  1356.     mainpanel.show();
  1357.  
  1358.     write3d(25,"Panels offer an attractive way to partition the graphics screen.");
  1359.     write3d(40,"Here are some of the different types of panels that can easily");
  1360.     write3d(55,"be implemented using the ObjectEase library.");
  1361.  
  1362.  
  1363.     Panel inthick;
  1364.     Panel inthin;
  1365.     Panel outthick;
  1366.     Panel outthin;
  1367.     Bevel thin;
  1368.     Bevel thick;
  1369.  
  1370.     delay(2000);
  1371.     write3d(90,"THICK STYLES                               THIN STYLES");
  1372.     inthick.init(50,105,200,100,IN,THICK);
  1373.     inthick.show();
  1374.     inthin.init(390,105,200,100,IN,THIN);
  1375.     inthin.show();
  1376.     delay(1000);
  1377.     outthick.init(50,220,200,100,OUT,THICK);
  1378.     outthick.show();
  1379.     outthin.init(390,220,200,100,OUT,THIN);
  1380.     outthin.show();
  1381.     delay(1000);
  1382.     thick.init(50,335,200,100,THICK);
  1383.     thick.show();
  1384.     thin.init(390,335,200,100,THIN);
  1385.     thin.show();
  1386.  
  1387.     the_mouse.show();
  1388.     flushkeys();
  1389.     while(!kbhit() && !the_mouse.RBP());
  1390.     if(kbhit()) {
  1391.         if((ch=getch())==27)
  1392.             early_exit();
  1393.         while(kbhit())getch();
  1394.         }
  1395.  
  1396. }
  1397.  
  1398. //**************************************************************************
  1399.  
  1400. void icondemo()
  1401. {
  1402.     the_mouse.hide();
  1403.     setfillstyle(SOLID_FILL,BKG);
  1404.     bar(0,0,getmaxx(),getmaxy()-40);
  1405.  
  1406.     Bevel mainpanel;
  1407.     mainpanel.init(50,50,getmaxx()-100,200,THICK);
  1408.     mainpanel.show();
  1409.  
  1410.     write3d(75,"What paint program would be complete without icons? Icons are");
  1411.     write3d(90,"as intuitive to use as buttons, and once again, using the");
  1412.     write3d(105,"ICONEDIT program, they are easy for you, the programmer, to");
  1413.     write3d(120,"create. Check out the action of the icons below...");
  1414.  
  1415.     Panel iconpanel;
  1416.     Icon drawicon;
  1417.     Icon painticon;
  1418.  
  1419.     iconpanel.init(250,160,getmaxx()-500,50,IN,THICK);
  1420.     iconpanel.show();
  1421.     drawicon.init(280,170,"draw");
  1422.     painticon.init(330,170,"painter");
  1423.     drawicon.show();
  1424.     painticon.show();
  1425.     the_mouse.show();
  1426.  
  1427.     flushkeys();
  1428.     int selected=0;
  1429.     while(!selected) {
  1430.         if(the_mouse.RBP())
  1431.             selected=1;
  1432.         if(kbhit()) {
  1433.             if((ch=getch())==27)
  1434.                 early_exit();
  1435.             while(kbhit())getch();
  1436.             selected=1;
  1437.             }
  1438.         if(the_mouse.LBP()) {
  1439.             if(painticon.hit()) {
  1440.                 if(!painticon.ispressed()) {
  1441.                     painticon.choose();
  1442.                     drawicon.show();
  1443.                     while(the_mouse.LBP());
  1444.                     continue;
  1445.                     }
  1446.                 }
  1447.             if(drawicon.hit()) {
  1448.                 if(!drawicon.ispressed()) {
  1449.                     drawicon.choose();
  1450.                     painticon.show();
  1451.                     while(the_mouse.LBP());
  1452.                     continue;
  1453.                     }
  1454.                 }
  1455.             }
  1456.         }
  1457. }
  1458.  
  1459. //**************************************************************************
  1460.  
  1461. void acticondemo()
  1462. {
  1463.     the_mouse.hide();
  1464.     setfillstyle(SOLID_FILL,BKG);
  1465.     bar(0,0,getmaxx(),getmaxy()-40);
  1466.  
  1467.     Bevel mainpanel;
  1468.     mainpanel.init(50,50,getmaxx()-100,300,THICK);
  1469.     mainpanel.show();
  1470.  
  1471.     write3d(75,"Here's a neat graphic feature that you don't see everyday.");
  1472.     write3d(90,"Want to really jazz up your interface? Want to make it stand");
  1473.     write3d(105,"out in a crowd?! Instead of reversing the image of your icons");
  1474.     write3d(120,"when they are selected, make them come to life! Click the icon");
  1475.     write3d(135,"below to see what I mean.");
  1476.     write3d(165,"And guess what... Right! These icons are also easy to create");
  1477.     write3d(180,"using the ICONEDIT program");
  1478.  
  1479.     Panel iconpanel;
  1480.     iconpanel.init(270,230,getmaxx()-(270*2),70,IN,THICK);
  1481.     iconpanel.show();
  1482.     Acticon aicon;
  1483.     aicon.init(305,250,"icon");
  1484.     aicon.show(1);
  1485.     the_mouse.show();
  1486.  
  1487.     int selected=0;
  1488.     while(!selected) {
  1489.         if(the_mouse.RBP())
  1490.             selected=1;
  1491.         if(kbhit()) {
  1492.             if((ch=getch())==27)
  1493.                 early_exit();
  1494.             while(kbhit())getch();
  1495.             selected=1;
  1496.             }
  1497.         if(the_mouse.LBP()) {
  1498.             if(aicon.hit()) {
  1499.                 while(!the_mouse.RBP() && !kbhit())
  1500.                     aicon.backforth(2);
  1501.                 if(kbhit()) {
  1502.                     flushkeys();
  1503.                     selected=1;
  1504.                     }
  1505.                 if(the_mouse.RBP())
  1506.                     selected=1;
  1507.                 }
  1508.             }
  1509.         }
  1510. }
  1511.  
  1512. //**************************************************************************
  1513.  
  1514. void gmenudemo()
  1515. {
  1516.     the_mouse.hide();
  1517.     setfillstyle(SOLID_FILL,BKG);
  1518.     bar(0,0,getmaxx(),getmaxy()-40);
  1519.  
  1520.     Bevel mainpanel;
  1521.     mainpanel.init(30,50,getmaxx()-60,130,THICK);
  1522.     mainpanel.show();
  1523.  
  1524.     write3d(75,"Do you need to include point and shoot type menu bars in your");
  1525.     write3d(90,"applications? No problem! Using the ObjectEase library makes it a snap");
  1526.     write3d(105,"for you to include graphic pulldown menus! See for yourself below.");
  1527.     write3d(120,"You may want to note that the way these menus are implemented");
  1528.     write3d(135,"requires you to keep the left mouse key pressed until you have made");
  1529.     write3d(150,"your selection.");
  1530.  
  1531.     setfillstyle(SOLID_FILL,15);
  1532.     bar(0,200,getmaxx(),210);
  1533.     setfillstyle(SOLID_FILL,1);
  1534.     bar(0,211,getmaxx(),350);
  1535.  
  1536.     Gmenubutton menubutton1;
  1537.     Gmenubutton menubutton2;
  1538.     gitemarray  itemarray1;
  1539.     gitemarray  itemarray2;
  1540.     Gmenu       gmenu1;
  1541.     Gmenu       gmenu2;
  1542.  
  1543.     strcpy(itemarray1[1],"Item 1");
  1544.     strcpy(itemarray1[2],"Item 2");
  1545.     strcpy(itemarray1[3],"Item 3");
  1546.     strcpy(itemarray1[4],"Item 4");
  1547.  
  1548.     strcpy(itemarray2[1],"Item 1");
  1549.     strcpy(itemarray2[2],"Item 2");
  1550.     strcpy(itemarray2[3],"Item 3");
  1551.     strcpy(itemarray2[4],"Item 4");
  1552.  
  1553.     gmenu1.init(0,211,4,itemarray1);
  1554.     gmenu2.init(100,211,4,itemarray2);
  1555.  
  1556.     menubutton1.init(0,200,0,15,15,0,"Menu 1");
  1557.     menubutton2.init(100,200,0,15,15,0,"Menu 2");
  1558.     menubutton1.show();
  1559.     menubutton2.show();
  1560.     the_mouse.show();
  1561.  
  1562.     int selected=0;
  1563.     while(!selected) {
  1564.         if(kbhit()) {
  1565.             if((ch=getch())==27)
  1566.                 early_exit();
  1567.             flushkeys();
  1568.             selected=1;
  1569.             }
  1570.         if(the_mouse.RBP())
  1571.             selected=1;
  1572.         if(the_mouse.LBP()) {
  1573.             if(menubutton1.hit()) {
  1574.                 menubutton1.press();
  1575.                 gmenu1.show();
  1576.                 gmenu1.hide();
  1577.                 menubutton1.show();
  1578.                 }
  1579.             if(menubutton2.hit()) {
  1580.                 menubutton2.press();
  1581.                 gmenu2.show();
  1582.                 gmenu2.hide();
  1583.                 menubutton2.show();
  1584.                 }
  1585.             }
  1586.         }
  1587. }
  1588.  
  1589. //**************************************************************************
  1590.  
  1591. void inputdemo()
  1592. {
  1593.     the_mouse.hide();
  1594.     setfillstyle(SOLID_FILL,BKG);
  1595.     bar(0,0,getmaxx(),getmaxy()-40);
  1596.  
  1597.     Bevel mainpanel;
  1598.     mainpanel.init(30,50,getmaxx()-60,150,THICK);
  1599.     mainpanel.show();
  1600.  
  1601.     write3d(75,"Getting text input from a graphic based application used to be");
  1602.     write3d(90,"a real hassle... NO MORE! The ObjectEase includes functions for");
  1603.     write3d(105,"laying out text input fields, simulating the text cursor, and");
  1604.     write3d(120,"handling the text strings input by the user. Now you can");
  1605.     write3d(135,"capture graphic text input as easily as in text mode.");
  1606.     write3d(150,"Try out the sample dialog below.");
  1607.  
  1608.     Panel dialogpanel;
  1609.     dialogpanel.init(150,250,getmaxx()-300,85,IN,THICK);
  1610.     dialogpanel.show();
  1611.  
  1612.     setcolor(15);
  1613.     settextjustify(LEFT_TEXT,TOP_TEXT);
  1614.     gprintxy(170,275,"First Name: ");
  1615.     gprintxy(170,305,"Last Name:  ");
  1616.  
  1617.     Gstring fname;
  1618.     Gstring lname;
  1619.     fname.init(270,279,20,0);
  1620.     lname.init(270,309,20,0);
  1621.     fname.show();
  1622.     lname.show();
  1623.  
  1624.     fname.get_input();
  1625.     lname.get_input();
  1626.  
  1627.     write3d(400,"Press <ENTER> to continue...");
  1628.  
  1629.     flushkeys();
  1630.     while(!the_mouse.RBP() && !kbhit());
  1631.     if(kbhit()) {
  1632.         if((ch=getch())==27)
  1633.             early_exit();
  1634.         flushkeys();
  1635.         }
  1636. }
  1637.  
  1638. //**************************************************************************
  1639.  
  1640. void finale()
  1641. {
  1642.     sumitup();
  1643.     setgraphmode(VGAHI);
  1644.     dlay(18);
  1645.     the_mouse.hide();
  1646.     setfillstyle(SOLID_FILL,BKG);
  1647.     bar(0,0,getmaxx(),getmaxy()-40);
  1648.  
  1649.     Bevel mainpanel;
  1650.     mainpanel.init(20,50,getmaxx()-40,330,THICK);
  1651.     mainpanel.show();
  1652.  
  1653.     write3d(75,"Thank you for previewing the ObjectEase library from");
  1654.     write3d(90,"David S. Reinhart Associates.");
  1655.     write3d(110,"If you're serious about developing efficient, well");
  1656.     write3d(125,"structured C++ programs, then the ObjectEase library");
  1657.     write3d(140,"is a must for you! Why spend YOUR valuable time recreating");
  1658.     write3d(155,"these powerful tools? Why spend hundreds of dollars to");
  1659.     write3d(170,"acquire the multiple libraries it would take to duplicate");
  1660.     write3d(185,"the features of ObjectEase? Order today! Your satisfaction");
  1661.     write3d(200,"is GUARANTEED!");
  1662.     write3d(220,"Single copy license - $79.95 each");
  1663.     write3d(235,"Four or more copies - $59.95 each");
  1664.     write3d(270,"David S. Reinhart Associates");
  1665.     write3d(295,"1004 Marticville Rd.");
  1666.     write3d(310,"Pequea, PA  17565");
  1667.     write3d(325,"(717) 284-3736");
  1668.  
  1669.     while(!kbhit() && !the_mouse.RBP());
  1670.     flushkeys();
  1671. }
  1672.  
  1673. //**************************************************************************
  1674.  
  1675. void write3d(int y,char *text)
  1676. {
  1677.     settextjustify(CENTER_TEXT,TOP_TEXT);
  1678.     setcolor(0);
  1679.     outtextxy(getmaxx()/2,y,text);
  1680.     setcolor(15);
  1681.     outtextxy((getmaxx()/2)-1,y-1,text);
  1682. }
  1683.  
  1684. //**************************************************************************
  1685.  
  1686. void do_siren()
  1687. {
  1688.     int i;
  1689.  
  1690.     for(i=500;i<1000;i+=7) {
  1691.         sound(i);
  1692.         delay(12);
  1693.         }
  1694.     for(i=1000;i>500;i-=7) {
  1695.         sound(i);
  1696.         delay(12);
  1697.         }
  1698.     nosound();
  1699. }
  1700.  
  1701. //**************************************************************************
  1702.  
  1703. void do_tele()
  1704. {
  1705.     int i;
  1706.  
  1707.     for(i=0;i<14;i++) {
  1708.         sound(440);
  1709.         delay(30);
  1710.         sound(880);
  1711.         delay(30);
  1712.         }
  1713.     nosound();
  1714. }
  1715.  
  1716. //**************************************************************************
  1717.  
  1718. void early_exit()
  1719. {
  1720.     closegraph();
  1721.     puts("You have not seen the entire demonstration.");
  1722.     exit(0);
  1723. }
  1724.  
  1725. //**************************************************************************\
  1726.  
  1727. void norm_exit()
  1728. {
  1729.     closegraph();
  1730.     printat(1,1,14,0,"Thank you for previewing the ObjectEase library from David S. Reinhart Associates.");
  1731.     printat(1,3,14,0,"Please read the enclosed documentation for complete instructions");
  1732.     printat(1,4,14,0,"on using these objects and functions in your programs. Please note");
  1733.     printat(1,5,14,0,"that this package is complete and not crippled or restricted");
  1734.     printat(1,6,14,0,"in any way. If you decide to use this library in your own programs");
  1735.     printat(1,7,14,0,"you must register your copy with the author. Failure to do so will");
  1736.     printat(1,8,14,0,"bring about severe penalties. Use the registration form supplied");
  1737.     printat(1,9,14,0,"in the file \"REGISTER.DOC\" to register your copy.");
  1738.     printat(1,11,14,0,"Again, thank you and happy programming.");
  1739.     gotoxy(1,13);
  1740. }
  1741.  
  1742. //**************************************************************************
  1743.  
  1744.  
  1745. void intro();
  1746. void demo1();
  1747. void demo2();
  1748. void demo3();
  1749. void demo4();
  1750. void demo5();
  1751. void demo6();
  1752. void outro();
  1753.  
  1754. unsigned char def_pal[17];
  1755.  
  1756. void initvidbiosdemo()
  1757. {
  1758.     char ch;
  1759.  
  1760.     the_mouse.init();
  1761.     the_mouse.unarm();
  1762.     randomize();
  1763.     cursoroff();
  1764.     clrscr();
  1765.  
  1766.     Twindow mainwindow;
  1767.     mainwindow.init(1,1,80,25,15,0,0,0);
  1768.     mainwindow.title("VIDBIOS DEMO");
  1769.     mainwindow.setborder(DOUBLE);
  1770.     mainwindow.show();
  1771.  
  1772.     intro();
  1773.     demo1();
  1774.     mainwindow.fill();
  1775.     demo2();
  1776.     mainwindow.fill();
  1777.     demo3();
  1778.     mainwindow.fill();
  1779.     demo4();
  1780.     mainwindow.fill();
  1781.     demo5();
  1782.     mainwindow.fill();
  1783.     demo6();
  1784.     clear(32,0,0);
  1785.     dlay(18);
  1786. //    mainwindow.fill();
  1787. //    outro();
  1788.  
  1789. //    mainwindow.hide();
  1790.     cursoron();
  1791. }
  1792.  
  1793. //*************************************************************************
  1794.  
  1795. void intro()
  1796. {
  1797.     Twindow introwindow;
  1798.     introwindow.init(4,6,77,18,14,2,0,0);
  1799.     introwindow.title("Introduction");
  1800.     introwindow.show();
  1801.  
  1802.     printc(8,14,2,"This short demo program highlights the video bios features of the");
  1803.     printc(9,14,2,"ObjectEase library. Note that these library functions will work ONLY on");
  1804.     printc(10,14,2,"VGA cards. If the program you are developing is intended for use on");
  1805.     printc(11,14,2,"a variety of video equipment, be sure to test for the existence of");
  1806.     printc(12,14,2,"a VGA card before calling these functions. If using an accelerated");
  1807.     printc(13,14,2,"video card the fade routines will happen too quickly to be" );
  1808.     printc(14,14,2,"appreciated. They will work fine on any standard VGA card.");
  1809.     printc(16,15,2,"Press any key now to get on with the show...");
  1810.  
  1811.     getch();
  1812.     introwindow.hide();
  1813.     flushkeys();
  1814. }
  1815.  
  1816. //*************************************************************************
  1817.  
  1818. void demo1()
  1819. {
  1820.     Twindow demo1window;
  1821.  
  1822.     demo1window.init(40,8,76,13,15,1,0,0);
  1823.     demo1window.show();
  1824.     printat(42,10,15,1," Fade any indivual palette color");
  1825.     printat(42,11,15,1,"     in and out as desired.     ");
  1826.  
  1827.     printat(5,5,1,0,"Blue         ████████");
  1828.     printat(5,6,2,0,"Green        ████████");
  1829.     printat(5,7,3,0,"Cyan         ████████");
  1830.     printat(5,8,4,0,"Red          ████████");
  1831.     printat(5,9,5,0,"Magenta      ████████");
  1832.     printat(5,10,6,0,"Brown        ████████");
  1833.     printat(5,11,7,0,"Lt. Gray     ████████");
  1834.     printat(5,12,8,0,"Dk. Gray     ████████");
  1835.     printat(5,13,9,0,"Br. Blue     ████████");
  1836.     printat(5,14,10,0,"Br. Green    ████████");
  1837.     printat(5,15,11,0,"Br. Cyan     ████████");
  1838.     printat(5,16,12,0,"Br. Red      ████████");
  1839.     printat(5,17,13,0,"Br. Magenta  ████████");
  1840.     printat(5,18,14,0,"Yellow       ████████");
  1841.     printat(5,19,15,0,"White        ████████");
  1842.  
  1843.     delay(1500);
  1844.     for(int i=1;i<16;i++) {
  1845.         fadeout(i);
  1846.         fadein(i);
  1847.         }
  1848.     demo1window.fill();
  1849.     printat(42,11,15,1,"         Press any key...   ");
  1850.     getch();
  1851.     flushkeys();
  1852.     demo1window.hide();
  1853. }
  1854.  
  1855. //**************************************************************************
  1856.  
  1857. void demo2()
  1858. {
  1859.     Twindow demo2window;
  1860.     demo2window.init(20,5,61,10,15,1,0,0);
  1861.     demo2window.show();
  1862.     printc(7,15,1,"Instantly set any color to black,");
  1863.     printc(8,15,1,"then fade in when appropriate.");
  1864.  
  1865.  
  1866.     Twindow greenwindow;
  1867.     Twindow cyanwindow;
  1868.     Twindow redwindow;
  1869.     Twindow magentawindow;
  1870.     Twindow brownwindow;
  1871.  
  1872.     greenwindow.init(15,12,25,17,2,2,0,0);
  1873.     blankcolor(2);
  1874.     cyanwindow.init(25,12,35,17,3,3,0,0);
  1875.     blankcolor(3);
  1876.     redwindow.init(35,12,45,17,4,4,0,0);
  1877.     blankcolor(4);
  1878.     magentawindow.init(45,12,55,17,5,5,0,0);
  1879.     blankcolor(5);
  1880.     brownwindow.init(55,12,65,17,6,6,0,0);
  1881.     blankcolor(6);
  1882.  
  1883.     greenwindow.show();
  1884.     cyanwindow.show();
  1885.     redwindow.show();
  1886.     magentawindow.show();
  1887.     brownwindow.show();
  1888.  
  1889.     delay(1500);
  1890.     fadein(2);
  1891.     delay(500);
  1892.     fadein(3);
  1893.     delay(500);
  1894.     fadein(4);
  1895.     delay(500);
  1896.     fadein(5);
  1897.     delay(500);
  1898.     fadein(6);
  1899.     delay(500);
  1900.  
  1901.  
  1902.     demo2window.fill();
  1903.     printc(8,15,1,"Press any key...");
  1904.     getch();
  1905.     flushkeys();
  1906.     brownwindow.hide();
  1907.     magentawindow.hide();
  1908.     redwindow.hide();
  1909.     cyanwindow.hide();
  1910.     greenwindow.hide();
  1911.     demo2window.hide();
  1912. }
  1913.  
  1914. //**************************************************************************
  1915.  
  1916. void demo3()
  1917. {
  1918.     Twindow demo3window;
  1919.  
  1920.     demo3window.init(10,5,71,7,15,2,0,0);
  1921.     demo3window.show();
  1922.     printc(6,15,2,"\"Slide\" from one color into the next for exciting effects!");
  1923.  
  1924.     Twindow slidewindow;
  1925.     slidewindow.init(20,12,61,22,1,1,0,0);
  1926.     slidewindow.show();
  1927.     delay(1000);
  1928.     fade1_3();
  1929.     delay(500);
  1930.     fade3_1();
  1931.     delay(500);
  1932.     fade1_4();
  1933.     delay(500);
  1934.     fade4_1();
  1935.     delay(500);
  1936.     fade1_5();
  1937.     delay(500);
  1938.     fade5_1();
  1939.     delay(500);
  1940.  
  1941.     demo3window.fill();
  1942.     printc(6,15,2,"Press any key...");
  1943.     getch();
  1944.     flushkeys();
  1945.     slidewindow.hide();
  1946.     demo3window.hide();
  1947. }
  1948.  
  1949. //**************************************************************************
  1950.  
  1951. void demo4()
  1952. {
  1953.     Twindow demo4window;
  1954.     int r,g,b,i;
  1955.  
  1956.     demo4window.init(40,5,75,14,15,1,0,0);
  1957.     demo4window.show();
  1958.     printat(42,7,15,1,"   Bored with the standard 16");
  1959.     printat(42,8,15,1,"         color palette?");
  1960.     printat(42,10,15,1,"           CHANGE IT!");
  1961.  
  1962.     printat(5,5,1,0,"Color 1      ████████");
  1963.     printat(5,6,2,0,"Color 2      ████████");
  1964.     printat(5,7,3,0,"Color 3      ████████");
  1965.     printat(5,8,4,0,"Color 4      ████████");
  1966.     printat(5,9,5,0,"Color 5      ████████");
  1967.     printat(5,10,6,0,"Color 6      ████████");
  1968.     printat(5,11,7,0,"Color 7      ████████");
  1969.     printat(5,12,8,0,"Color 8      ████████");
  1970.     printat(5,13,9,0,"Color 9      ████████");
  1971.     printat(5,14,10,0,"Color 10     ████████");
  1972.     printat(5,15,11,0,"Color 11     ████████");
  1973.     printat(5,16,12,0,"Color 12     ████████");
  1974.     printat(5,17,13,0,"Color 13     ████████");
  1975.     printat(5,18,14,0,"Color 14     ████████");
  1976.     printat(5,19,15,0,"Color 15     ████████");
  1977.  
  1978.     delay(3000);
  1979.     printat(42,12,15,1,"     Press any key to end...");
  1980.     flushkeys();
  1981.     while(!kbhit()) {
  1982.         for(i=1;i<16;i++)
  1983.             rgb(i,random(63),random(63),random(63));
  1984.         delay(1000);
  1985.         }
  1986.     set_default_palette();
  1987.     delay(2000);
  1988.     demo4window.hide();
  1989. }
  1990.  
  1991. //**************************************************************************
  1992.  
  1993. void demo5()
  1994. {
  1995.     Twindow demo5window;
  1996.  
  1997.     demo5window.init(5,5,76,12,15,1,0,0);
  1998.     demo5window.show();
  1999.  
  2000.     printc(7,15,1,"As you know, if you try to use colors 8 through 15 as");
  2001.     printc(8,15,1,"background colors, the foreground begins to blink against your will.");
  2002.     delay(2000);
  2003.     printc(10,14,1,"Well now you're in control!");
  2004.  
  2005.     disable_blink();
  2006.     delay(1000);
  2007.     printc(15,0,15,"     Black on white    ");
  2008.     delay(1000);
  2009.     printc(17,5,14,"   Magenta on yellow   ");
  2010.     delay(1000);
  2011.     printc(19,15,9,"    Any combination!   ");
  2012.     delay(2000);
  2013.  
  2014.     printc(22,15,0,"Press any key...");
  2015.  
  2016.     flushkeys();
  2017.     getch();
  2018.     enable_blink();
  2019.     demo5window.hide();
  2020. }
  2021.  
  2022. //**************************************************************************
  2023.  
  2024. void demo6()
  2025. {
  2026.     Twindow demo6window;
  2027.     demo6window.init(5,5,76,13,15,1,0,0);
  2028.     demo6window.show();
  2029.  
  2030.     printc(7,15,1,"Ever want to turn the screen off during a massive screen");
  2031.     printc(8,15,1,"drawing routine so that the user doesn't have to (or doesn't");
  2032.     printc(9,15,1,"get to) see it all happening?");
  2033.     delay(3000);
  2034.     printc(11,14,1,"Press any key to DO IT!");
  2035.  
  2036.     flushkeys();
  2037.     getch();
  2038.     flushkeys();
  2039.     disable_refresh();
  2040.     demo6window.hide();
  2041.  
  2042.     Twindow w1,w2,w3,w4,w5;
  2043.     w1.init(15,5,25,10,15,1,1,7);
  2044.     w1.show();
  2045.     w2.init(25,7,35,12,15,2,1,7);
  2046.     w2.show();
  2047.     w3.init(35,9,45,14,15,3,1,7);
  2048.     w3.show();
  2049.     w4.init(45,11,55,16,15,4,1,7);
  2050.     w4.show();
  2051.     w5.init(55,13,65,18,15,5,1,7);
  2052.     w5.show();
  2053.  
  2054.     delay(1000);
  2055.     enable_refresh();
  2056.     delay(1500);
  2057.  
  2058.     printc(22,15,0,"Press any key...");
  2059.     flushkeys();
  2060.     getch();
  2061. }
  2062.  
  2063. //**************************************************************************
  2064.  
  2065. void outro()
  2066. {
  2067.     Twindow outrowindow;
  2068.     outrowindow.init(4,6,77,18,14,2,0,0);
  2069.     outrowindow.title("Summary");
  2070.     outrowindow.show();
  2071.  
  2072.     printc(8,14,2,"These are the highlights...the raw materials for your");
  2073.     printc(9,14,2,"creative ideas. Note that while this demo was in text mode,");
  2074.     printc(10,14,2,"these functions work equally as well in graphics mode.");
  2075.     printc(11,14,2,"Please read the complete documentation file for specific");
  2076.     printc(12,14,2,"information on using these functions in your programs.");
  2077.     printc(14,14,2,"Thank you for previewing software from Ludicrous Data.");
  2078.     printc(16,15,2,"Press any key now to return to DOS...");
  2079.  
  2080.     flushkeys();
  2081.     getch();
  2082.     flushkeys();
  2083.     outrowindow.hide();
  2084. }
  2085.  
  2086. //**************************************************************************
  2087. //        SUMITUP
  2088. //**************************************************************************
  2089.  
  2090. void sumitup()
  2091. {
  2092.     restorecrtmode();
  2093.     dlay(18);
  2094.     cursoroff();
  2095.     Twindow mainwindow;
  2096.     mainwindow.init(5,1,76,23,15,1,0,0);
  2097.     mainwindow.show();
  2098.     mainwindow.divider(HOR,DOUBLE,2);
  2099.     mainwindow.wprintc(1,14,1,"That's not all...");
  2100.  
  2101.     printc(5,15,1,"This demo can hardly describe all of the features and power");
  2102.     printc(6,15,1,"at your beckoning by using the ObjectEase library. There are");
  2103.     printc(7,15,1,"many more classes for which there just isn't time to");
  2104.     printc(8,15,1,"demonstrate here. Some of these include: SoundQ which allows");
  2105.     printc(9,15,1,"you to play music in the background while foreground processes");
  2106.     printc(10,15,1,"continue to execute; Output routines which allow fast, snow-");
  2107.     printc(11,15,1,"free output to the screen; Bitmaps which allow you to include");
  2108.     printc(12,15,1,"and manipulate graphic images within your programs; Support");
  2109.     printc(13,15,1,"for 256 color graphics modes and editors for creating button,");
  2110.     printc(14,15,1,"icon, and bitmap images for these graphics modes. The list goes");
  2111.     printc(15,15,1,"on! Ask yourself what it will cost if you don't acquire this");
  2112.     printc(16,15,1,"extensive library. Ask what it would cost to piece it together");
  2113.     printc(17,15,1,"from other vendor's libraries. Now tell yourself of the power");
  2114.     printc(18,15,1,"and efficiency you will gain by acquiring this library now!");
  2115.     printc(19,15,1,"What are you waiting for?!");
  2116.     dlay(18*8);
  2117.     printc(21,15+128,1,"Press any key...");
  2118.     flushkeys();
  2119.     getch();
  2120.     flushkeys();
  2121. }
  2122.  
  2123.